class Api::SecondCategoriesController < Api::BaseController

  def index
    if params[:parent_id]
      @categories = Category.find(params[:parent_id]).children
    else
      @categories = Category.all
    end
    items = @categories.map{|c| c.summary_builder}
    api_success(message: '', data: { items: items })
  end

end
